const path = require('path');
const { defineConfig } = require('@vue/cli-service')
console.log(path.resolve(__dirname, "./code-loader.js"))
module.exports = defineConfig({
  publicPath: './',
  transpileDependencies: true,
  filenameHashing: false,
  chainWebpack: config => {
    config.module
      // 添加一个 loader
      .rule('vue')
      .after()
      .rule('code')
      .test(/\.vue$/)
      .use('code-loader')
      .loader(path.resolve(__dirname, "./code-loader.js"))
      .end()
  },
  css: {
    loaderOptions: {
      sass: {
        additionalData: [
          `@import "./src/assets/variable.scss";`,
          `@import "./src/assets/mixins.scss";`
        ].join('\n')
      }
    }
  }

})
